package org.come.Jpanel;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

import org.come.Frame.CreatBangJframe;

import com.tool.btn.CreatBangBtn;
import com.tool.btn.FormsOnOffBtn;
import com.tool.tcpimg.UIUtils;
import com.updateNew.MyIsif;



/**
 * 创建帮派
 * @author 郑天宇
 * @date : 2017年12月05日 下午05:00:00
 */
public class CreatBangJpanel extends JPanel {
    private JTextArea setword1;
    private JTextField setword2;
    private CreatBangJframe creatBangjframe;
    private JLabel // 放置金额
    labtrade;
    private CreatBangBtn btnbang;// 创建帮派按钮
    private Color fontcolor;// 列表中对象的名字颜色

    public CreatBangJpanel(CreatBangJframe creatBangjframe) throws Exception {
        this.creatBangjframe = creatBangjframe;
        String style = MyIsif.getStyle();
        if ("水墨UI".equals(style)) {
        	this.setPreferredSize(new Dimension(351, 316));
            this.setLayout(null);
            this.setBackground(UIUtils.Color_BACK);
            // 关闭按钮事件
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/old/2/1.png", 1, 25);
            offBtn.setBounds(322, 10, 25, 25);
            this.add(offBtn);

            // 输入框1
            setword1 = new JTextArea();
            setword1.setLineWrap(true);
            setword1.setBounds(53, 90, 270, 88);
            setword1.setForeground(Color.white);
            setword1.setCaretColor(Color.white);
            setword1.setBackground(new Color(0, 0, 0, 0));
            setword1.setBorder(BorderFactory.createEmptyBorder());// password.setBorder(BorderFactory.createLineBorder(new
                                                                  // color(x,y,z)));
            setword1.setFont(UIUtils.TEXT_TIP);
            this.add(setword1);

            // 输入框2
            setword2 = new JTextField();
            setword2.setBounds(130, 35, 200, 16);
            setword2.setForeground(Color.white);
            setword2.setCaretColor(Color.white);
            setword2.setBackground(new Color(0, 0, 0, 0));
            setword2.setBorder(BorderFactory.createEmptyBorder());// password.setBorder(BorderFactory.createLineBorder(new
                                                                  // color(x,y,z)));
            setword2.setFont(UIUtils.TEXT_TIP);
            this.add(setword2);

            btnbang = new CreatBangBtn("skin/8100226/newbutton/B22.png", 1, "创建帮派", this, null);
            btnbang.setBounds(140, 200, 99, 24);
            this.add(btnbang);
        } else {
            this.setPreferredSize(new Dimension(337, 200));
            this.setLayout(null);
            this.setBackground(UIUtils.Color_BACK);
            // 关闭按钮事件
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/hongmu/s74.png", 1, 25);
            offBtn.setBounds(312, 0, 25, 25);
            this.add(offBtn);

            // 输入框1
            setword1 = new JTextArea();
            setword1.setLineWrap(true);
            setword1.setBounds(38, 90, 260, 60);
            setword1.setForeground(Color.white);
            setword1.setCaretColor(Color.white);
            setword1.setBackground(new Color(0, 0, 0, 0));
            setword1.setBorder(BorderFactory.createEmptyBorder());// password.setBorder(BorderFactory.createLineBorder(new
            // color(x,y,z)));
            setword1.setFont(UIUtils.TEXT_HY88);
            this.add(setword1);

            // 输入框2
            setword2 = new JTextField();
            setword2.setBounds(110, 43, 200, 19);
            setword2.setForeground(Color.white);
            setword2.setCaretColor(Color.white);
            setword2.setBackground(new Color(0, 0, 0, 0));
            setword2.setBorder(BorderFactory.createEmptyBorder());// password.setBorder(BorderFactory.createLineBorder(new
            // color(x,y,z)));
            setword2.setFont(UIUtils.TEXT_HY88);
            this.add(setword2);

            btnbang = new CreatBangBtn("inkImg/hongmu/1_png.button.btn_xy.png", 1, "创建帮派", this, null);
            btnbang.setColors(UIUtils.COLOR_BTNPUTONG2);
            btnbang.setFont(UIUtils.TEXT_HY88);
            btnbang.setBounds(140, 160, 80, 26);
            this.add(btnbang);
        }
    }

    ImageIcon icon;

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        String style = MyIsif.getStyle();
        if ("水墨UI".equals(style)) {
            if (icon == null)
        	icon = new ImageIcon("inkImg/newbackground/S60.png");
            g.drawImage(icon.getImage(), 0, 0, 358, 300, this);
        } else {
            if (icon == null)
                icon = new ImageIcon("img/xy2uiimg/100_png.xy2uiimg.groupcreate.png");
            g.drawImage(icon.getImage(), 0, 0, 337, 200, this);
        }

    }

    public CreatBangJframe getcreatBangjframe() {
        return creatBangjframe;
    }

    public void creatBangjframe(CreatBangJframe creatBangjframe) {
        this.creatBangjframe = creatBangjframe;
    }

    public JLabel getLabtrade() {
        return labtrade;
    }

    public void setLabtrade(JLabel labtrade) {
        this.labtrade = labtrade;
    }

    public Color getFontcolor() {
        return fontcolor;
    }

    public void setFontcolor(Color fontcolor) {
        this.fontcolor = fontcolor;
    }

    public JTextArea getSetword1() {
        return setword1;
    }

    public void setSetword1(JTextArea setword1) {
        this.setword1 = setword1;
    }

    public JTextField getSetword2() {
        return setword2;
    }

    public void setSetword2(JTextField setword2) {
        this.setword2 = setword2;
    }

}
